Integrand size = 26, antiderivative size = 821 \[ \int \frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2}{\left (f+g x^2\right )^2} \, dx=-\frac {(d+e x) \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{4 f \left (e \sqrt {-f}+d \sqrt {g}\right ) \left (\sqrt {-f}-\sqrt {g} x\right )}-\frac {(d+e x) \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{4 f \left (e \sqrt {-f}-d \sqrt {g}\right ) \left (\sqrt {-f}+\sqrt {g} x\right )}-\frac {b e n \left (a+b \log \left (c (d+e x)^n\right )\right ) \log \left (\frac {e \left (\sqrt {-f}-\sqrt {g} x\right )}{e \sqrt {-f}+d \sqrt {g}}\right )}{2 f \left (e \sqrt {-f}+d \sqrt {g}\right ) \sqrt {g}}-\frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2 \log \left (\frac {e \left (\sqrt {-f}-\sqrt {g} x\right )}{e \sqrt {-f}+d \sqrt {g}}\right )}{4 (-f)^{3/2} \sqrt {g}}-\frac {b e n \left (a+b \log \left (c (d+e x)^n\right )\right ) \log \left (\frac {e \left (\sqrt {-f}+\sqrt {g} x\right )}{e \sqrt {-f}-d \sqrt {g}}\right )}{2 \left (e (-f)^{3/2}+d f \sqrt {g}\right ) \sqrt {g}}+\frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2 \log \left (\frac {e \left (\sqrt {-f}+\sqrt {g} x\right )}{e \sqrt {-f}-d \sqrt {g}}\right )}{4 (-f)^{3/2} \sqrt {g}}-\frac {b^2 e n^2 \operatorname {PolyLog}\left (2,-\frac {\sqrt {g} (d+e x)}{e \sqrt {-f}-d \sqrt {g}}\right )}{2 \left (e (-f)^{3/2}+d f \sqrt {g}\right ) \sqrt {g}}+\frac {b n \left (a+b \log \left (c (d+e x)^n\right )\right ) \operatorname {PolyLog}\left (2,-\frac {\sqrt {g} (d+e x)}{e \sqrt {-f}-d \sqrt {g}}\right )}{2 (-f)^{3/2} \sqrt {g}}-\frac {b^2 e n^2 \operatorname {PolyLog}\left (2,\frac {\sqrt {g} (d+e x)}{e \sqrt {-f}+d \sqrt {g}}\right )}{2 f \left (e \sqrt {-f}+d \sqrt {g}\right ) \sqrt {g}}-\frac {b n \left (a+b \log \left (c (d+e x)^n\right )\right ) \operatorname {PolyLog}\left (2,\frac {\sqrt {g} (d+e x)}{e \sqrt {-f}+d \sqrt {g}}\right )}{2 (-f)^{3/2} \sqrt {g}}-\frac {b^2 n^2 \operatorname {PolyLog}\left (3,-\frac {\sqrt {g} (d+e x)}{e \sqrt {-f}-d \sqrt {g}}\right )}{2 (-f)^{3/2} \sqrt {g}}+\frac {b^2 n^2 \operatorname {PolyLog}\left (3,\frac {\sqrt {g} (d+e x)}{e \sqrt {-f}+d \sqrt {g}}\right )}{2 (-f)^{3/2} \sqrt {g}} \]
[Out]
Time = 0.59 (sec) , antiderivative size = 821, normalized size of antiderivative = 1.00, number of steps used = 20, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.346, Rules used = {2456, 2444, 2441, 2440, 2438, 2443, 2481, 2421, 6724} \[ \int \frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2}{\left (f+g x^2\right )^2} \, dx=-\frac {b^2 e \operatorname {PolyLog}\left (2,-\frac {\sqrt {g} (d+e x)}{e \sqrt {-f}-d \sqrt {g}}\right ) n^2}{2 \left (e (-f)^{3/2}+d f \sqrt {g}\right ) \sqrt {g}}-\frac {b^2 e \operatorname {PolyLog}\left (2,\frac {\sqrt {g} (d+e x)}{\sqrt {g} d+e \sqrt {-f}}\right ) n^2}{2 f \left (\sqrt {g} d+e \sqrt {-f}\right ) \sqrt {g}}-\frac {b^2 \operatorname {PolyLog}\left (3,-\frac {\sqrt {g} (d+e x)}{e \sqrt {-f}-d \sqrt {g}}\right ) n^2}{2 (-f)^{3/2} \sqrt {g}}+\frac {b^2 \operatorname {PolyLog}\left (3,\frac {\sqrt {g} (d+e x)}{\sqrt {g} d+e \sqrt {-f}}\right ) n^2}{2 (-f)^{3/2} \sqrt {g}}-\frac {b e \left (a+b \log \left (c (d+e x)^n\right )\right ) \log \left (\frac {e \left (\sqrt {-f}-\sqrt {g} x\right )}{\sqrt {g} d+e \sqrt {-f}}\right ) n}{2 f \left (\sqrt {g} d+e \sqrt {-f}\right ) \sqrt {g}}-\frac {b e \left (a+b \log \left (c (d+e x)^n\right )\right ) \log \left (\frac {e \left (\sqrt {g} x+\sqrt {-f}\right )}{e \sqrt {-f}-d \sqrt {g}}\right ) n}{2 \left (e (-f)^{3/2}+d f \sqrt {g}\right ) \sqrt {g}}+\frac {b \left (a+b \log \left (c (d+e x)^n\right )\right ) \operatorname {PolyLog}\left (2,-\frac {\sqrt {g} (d+e x)}{e \sqrt {-f}-d \sqrt {g}}\right ) n}{2 (-f)^{3/2} \sqrt {g}}-\frac {b \left (a+b \log \left (c (d+e x)^n\right )\right ) \operatorname {PolyLog}\left (2,\frac {\sqrt {g} (d+e x)}{\sqrt {g} d+e \sqrt {-f}}\right ) n}{2 (-f)^{3/2} \sqrt {g}}-\frac {(d+e x) \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{4 f \left (\sqrt {g} d+e \sqrt {-f}\right ) \left (\sqrt {-f}-\sqrt {g} x\right )}-\frac {(d+e x) \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{4 f \left (e \sqrt {-f}-d \sqrt {g}\right ) \left (\sqrt {g} x+\sqrt {-f}\right )}-\frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2 \log \left (\frac {e \left (\sqrt {-f}-\sqrt {g} x\right )}{\sqrt {g} d+e \sqrt {-f}}\right )}{4 (-f)^{3/2} \sqrt {g}}+\frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2 \log \left (\frac {e \left (\sqrt {g} x+\sqrt {-f}\right )}{e \sqrt {-f}-d \sqrt {g}}\right )}{4 (-f)^{3/2} \sqrt {g}} \]
[In]
[Out]
Rule 2421
Rule 2438
Rule 2440
Rule 2441
Rule 2443
Rule 2444
Rule 2456
Rule 2481
Rule 6724
Rubi steps \begin{align*} \text {integral}& = \int \left (-\frac {g \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{4 f \left (\sqrt {-f} \sqrt {g}-g x\right )^2}-\frac {g \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{4 f \left (\sqrt {-f} \sqrt {g}+g x\right )^2}-\frac {g \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{2 f \left (-f g-g^2 x^2\right )}\right ) \, dx \\ & = -\frac {g \int \frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2}{\left (\sqrt {-f} \sqrt {g}-g x\right )^2} \, dx}{4 f}-\frac {g \int \frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2}{\left (\sqrt {-f} \sqrt {g}+g x\right )^2} \, dx}{4 f}-\frac {g \int \frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2}{-f g-g^2 x^2} \, dx}{2 f} \\ & = -\frac {(d+e x) \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{4 f \left (e \sqrt {-f}+d \sqrt {g}\right ) \left (\sqrt {-f}-\sqrt {g} x\right )}-\frac {(d+e x) \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{4 f \left (e \sqrt {-f}-d \sqrt {g}\right ) \left (\sqrt {-f}+\sqrt {g} x\right )}-\frac {g \int \left (-\frac {\sqrt {-f} \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{2 f g \left (\sqrt {-f}-\sqrt {g} x\right )}-\frac {\sqrt {-f} \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{2 f g \left (\sqrt {-f}+\sqrt {g} x\right )}\right ) \, dx}{2 f}+\frac {\left (b e \sqrt {g} n\right ) \int \frac {a+b \log \left (c (d+e x)^n\right )}{\sqrt {-f} \sqrt {g}+g x} \, dx}{2 f \left (e \sqrt {-f}-d \sqrt {g}\right )}+\frac {\left (b e \sqrt {g} n\right ) \int \frac {a+b \log \left (c (d+e x)^n\right )}{\sqrt {-f} \sqrt {g}-g x} \, dx}{2 f \left (e \sqrt {-f}+d \sqrt {g}\right )} \\ & = -\frac {(d+e x) \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{4 f \left (e \sqrt {-f}+d \sqrt {g}\right ) \left (\sqrt {-f}-\sqrt {g} x\right )}-\frac {(d+e x) \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{4 f \left (e \sqrt {-f}-d \sqrt {g}\right ) \left (\sqrt {-f}+\sqrt {g} x\right )}-\frac {b e n \left (a+b \log \left (c (d+e x)^n\right )\right ) \log \left (\frac {e \left (\sqrt {-f}-\sqrt {g} x\right )}{e \sqrt {-f}+d \sqrt {g}}\right )}{2 f \left (e \sqrt {-f}+d \sqrt {g}\right ) \sqrt {g}}-\frac {b e n \left (a+b \log \left (c (d+e x)^n\right )\right ) \log \left (\frac {e \left (\sqrt {-f}+\sqrt {g} x\right )}{e \sqrt {-f}-d \sqrt {g}}\right )}{2 \left (e (-f)^{3/2}+d f \sqrt {g}\right ) \sqrt {g}}+\frac {\int \frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2}{\sqrt {-f}-\sqrt {g} x} \, dx}{4 (-f)^{3/2}}+\frac {\int \frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2}{\sqrt {-f}+\sqrt {g} x} \, dx}{4 (-f)^{3/2}}+\frac {\left (b^2 e^2 n^2\right ) \int \frac {\log \left (\frac {e \left (\sqrt {-f} \sqrt {g}-g x\right )}{e \sqrt {-f} \sqrt {g}+d g}\right )}{d+e x} \, dx}{2 f \left (e \sqrt {-f}+d \sqrt {g}\right ) \sqrt {g}}+\frac {\left (b^2 e^2 n^2\right ) \int \frac {\log \left (\frac {e \left (\sqrt {-f} \sqrt {g}+g x\right )}{e \sqrt {-f} \sqrt {g}-d g}\right )}{d+e x} \, dx}{2 \left (e (-f)^{3/2}+d f \sqrt {g}\right ) \sqrt {g}} \\ & = -\frac {(d+e x) \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{4 f \left (e \sqrt {-f}+d \sqrt {g}\right ) \left (\sqrt {-f}-\sqrt {g} x\right )}-\frac {(d+e x) \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{4 f \left (e \sqrt {-f}-d \sqrt {g}\right ) \left (\sqrt {-f}+\sqrt {g} x\right )}-\frac {b e n \left (a+b \log \left (c (d+e x)^n\right )\right ) \log \left (\frac {e \left (\sqrt {-f}-\sqrt {g} x\right )}{e \sqrt {-f}+d \sqrt {g}}\right )}{2 f \left (e \sqrt {-f}+d \sqrt {g}\right ) \sqrt {g}}-\frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2 \log \left (\frac {e \left (\sqrt {-f}-\sqrt {g} x\right )}{e \sqrt {-f}+d \sqrt {g}}\right )}{4 (-f)^{3/2} \sqrt {g}}-\frac {b e n \left (a+b \log \left (c (d+e x)^n\right )\right ) \log \left (\frac {e \left (\sqrt {-f}+\sqrt {g} x\right )}{e \sqrt {-f}-d \sqrt {g}}\right )}{2 \left (e (-f)^{3/2}+d f \sqrt {g}\right ) \sqrt {g}}+\frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2 \log \left (\frac {e \left (\sqrt {-f}+\sqrt {g} x\right )}{e \sqrt {-f}-d \sqrt {g}}\right )}{4 (-f)^{3/2} \sqrt {g}}+\frac {(b e n) \int \frac {\left (a+b \log \left (c (d+e x)^n\right )\right ) \log \left (\frac {e \left (\sqrt {-f}-\sqrt {g} x\right )}{e \sqrt {-f}+d \sqrt {g}}\right )}{d+e x} \, dx}{2 (-f)^{3/2} \sqrt {g}}-\frac {(b e n) \int \frac {\left (a+b \log \left (c (d+e x)^n\right )\right ) \log \left (\frac {e \left (\sqrt {-f}+\sqrt {g} x\right )}{e \sqrt {-f}-d \sqrt {g}}\right )}{d+e x} \, dx}{2 (-f)^{3/2} \sqrt {g}}+\frac {\left (b^2 e n^2\right ) \text {Subst}\left (\int \frac {\log \left (1-\frac {g x}{e \sqrt {-f} \sqrt {g}+d g}\right )}{x} \, dx,x,d+e x\right )}{2 f \left (e \sqrt {-f}+d \sqrt {g}\right ) \sqrt {g}}+\frac {\left (b^2 e n^2\right ) \text {Subst}\left (\int \frac {\log \left (1+\frac {g x}{e \sqrt {-f} \sqrt {g}-d g}\right )}{x} \, dx,x,d+e x\right )}{2 \left (e (-f)^{3/2}+d f \sqrt {g}\right ) \sqrt {g}} \\ & = -\frac {(d+e x) \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{4 f \left (e \sqrt {-f}+d \sqrt {g}\right ) \left (\sqrt {-f}-\sqrt {g} x\right )}-\frac {(d+e x) \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{4 f \left (e \sqrt {-f}-d \sqrt {g}\right ) \left (\sqrt {-f}+\sqrt {g} x\right )}-\frac {b e n \left (a+b \log \left (c (d+e x)^n\right )\right ) \log \left (\frac {e \left (\sqrt {-f}-\sqrt {g} x\right )}{e \sqrt {-f}+d \sqrt {g}}\right )}{2 f \left (e \sqrt {-f}+d \sqrt {g}\right ) \sqrt {g}}-\frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2 \log \left (\frac {e \left (\sqrt {-f}-\sqrt {g} x\right )}{e \sqrt {-f}+d \sqrt {g}}\right )}{4 (-f)^{3/2} \sqrt {g}}-\frac {b e n \left (a+b \log \left (c (d+e x)^n\right )\right ) \log \left (\frac {e \left (\sqrt {-f}+\sqrt {g} x\right )}{e \sqrt {-f}-d \sqrt {g}}\right )}{2 \left (e (-f)^{3/2}+d f \sqrt {g}\right ) \sqrt {g}}+\frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2 \log \left (\frac {e \left (\sqrt {-f}+\sqrt {g} x\right )}{e \sqrt {-f}-d \sqrt {g}}\right )}{4 (-f)^{3/2} \sqrt {g}}-\frac {b^2 e n^2 \text {Li}_2\left (-\frac {\sqrt {g} (d+e x)}{e \sqrt {-f}-d \sqrt {g}}\right )}{2 \left (e (-f)^{3/2}+d f \sqrt {g}\right ) \sqrt {g}}-\frac {b^2 e n^2 \text {Li}_2\left (\frac {\sqrt {g} (d+e x)}{e \sqrt {-f}+d \sqrt {g}}\right )}{2 f \left (e \sqrt {-f}+d \sqrt {g}\right ) \sqrt {g}}+\frac {(b n) \text {Subst}\left (\int \frac {\left (a+b \log \left (c x^n\right )\right ) \log \left (\frac {e \left (\frac {e \sqrt {-f}+d \sqrt {g}}{e}-\frac {\sqrt {g} x}{e}\right )}{e \sqrt {-f}+d \sqrt {g}}\right )}{x} \, dx,x,d+e x\right )}{2 (-f)^{3/2} \sqrt {g}}-\frac {(b n) \text {Subst}\left (\int \frac {\left (a+b \log \left (c x^n\right )\right ) \log \left (\frac {e \left (\frac {e \sqrt {-f}-d \sqrt {g}}{e}+\frac {\sqrt {g} x}{e}\right )}{e \sqrt {-f}-d \sqrt {g}}\right )}{x} \, dx,x,d+e x\right )}{2 (-f)^{3/2} \sqrt {g}} \\ & = -\frac {(d+e x) \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{4 f \left (e \sqrt {-f}+d \sqrt {g}\right ) \left (\sqrt {-f}-\sqrt {g} x\right )}-\frac {(d+e x) \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{4 f \left (e \sqrt {-f}-d \sqrt {g}\right ) \left (\sqrt {-f}+\sqrt {g} x\right )}-\frac {b e n \left (a+b \log \left (c (d+e x)^n\right )\right ) \log \left (\frac {e \left (\sqrt {-f}-\sqrt {g} x\right )}{e \sqrt {-f}+d \sqrt {g}}\right )}{2 f \left (e \sqrt {-f}+d \sqrt {g}\right ) \sqrt {g}}-\frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2 \log \left (\frac {e \left (\sqrt {-f}-\sqrt {g} x\right )}{e \sqrt {-f}+d \sqrt {g}}\right )}{4 (-f)^{3/2} \sqrt {g}}-\frac {b e n \left (a+b \log \left (c (d+e x)^n\right )\right ) \log \left (\frac {e \left (\sqrt {-f}+\sqrt {g} x\right )}{e \sqrt {-f}-d \sqrt {g}}\right )}{2 \left (e (-f)^{3/2}+d f \sqrt {g}\right ) \sqrt {g}}+\frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2 \log \left (\frac {e \left (\sqrt {-f}+\sqrt {g} x\right )}{e \sqrt {-f}-d \sqrt {g}}\right )}{4 (-f)^{3/2} \sqrt {g}}-\frac {b^2 e n^2 \text {Li}_2\left (-\frac {\sqrt {g} (d+e x)}{e \sqrt {-f}-d \sqrt {g}}\right )}{2 \left (e (-f)^{3/2}+d f \sqrt {g}\right ) \sqrt {g}}+\frac {b n \left (a+b \log \left (c (d+e x)^n\right )\right ) \text {Li}_2\left (-\frac {\sqrt {g} (d+e x)}{e \sqrt {-f}-d \sqrt {g}}\right )}{2 (-f)^{3/2} \sqrt {g}}-\frac {b^2 e n^2 \text {Li}_2\left (\frac {\sqrt {g} (d+e x)}{e \sqrt {-f}+d \sqrt {g}}\right )}{2 f \left (e \sqrt {-f}+d \sqrt {g}\right ) \sqrt {g}}-\frac {b n \left (a+b \log \left (c (d+e x)^n\right )\right ) \text {Li}_2\left (\frac {\sqrt {g} (d+e x)}{e \sqrt {-f}+d \sqrt {g}}\right )}{2 (-f)^{3/2} \sqrt {g}}-\frac {\left (b^2 n^2\right ) \text {Subst}\left (\int \frac {\text {Li}_2\left (-\frac {\sqrt {g} x}{e \sqrt {-f}-d \sqrt {g}}\right )}{x} \, dx,x,d+e x\right )}{2 (-f)^{3/2} \sqrt {g}}+\frac {\left (b^2 n^2\right ) \text {Subst}\left (\int \frac {\text {Li}_2\left (\frac {\sqrt {g} x}{e \sqrt {-f}+d \sqrt {g}}\right )}{x} \, dx,x,d+e x\right )}{2 (-f)^{3/2} \sqrt {g}} \\ & = -\frac {(d+e x) \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{4 f \left (e \sqrt {-f}+d \sqrt {g}\right ) \left (\sqrt {-f}-\sqrt {g} x\right )}-\frac {(d+e x) \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{4 f \left (e \sqrt {-f}-d \sqrt {g}\right ) \left (\sqrt {-f}+\sqrt {g} x\right )}-\frac {b e n \left (a+b \log \left (c (d+e x)^n\right )\right ) \log \left (\frac {e \left (\sqrt {-f}-\sqrt {g} x\right )}{e \sqrt {-f}+d \sqrt {g}}\right )}{2 f \left (e \sqrt {-f}+d \sqrt {g}\right ) \sqrt {g}}-\frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2 \log \left (\frac {e \left (\sqrt {-f}-\sqrt {g} x\right )}{e \sqrt {-f}+d \sqrt {g}}\right )}{4 (-f)^{3/2} \sqrt {g}}-\frac {b e n \left (a+b \log \left (c (d+e x)^n\right )\right ) \log \left (\frac {e \left (\sqrt {-f}+\sqrt {g} x\right )}{e \sqrt {-f}-d \sqrt {g}}\right )}{2 \left (e (-f)^{3/2}+d f \sqrt {g}\right ) \sqrt {g}}+\frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2 \log \left (\frac {e \left (\sqrt {-f}+\sqrt {g} x\right )}{e \sqrt {-f}-d \sqrt {g}}\right )}{4 (-f)^{3/2} \sqrt {g}}-\frac {b^2 e n^2 \text {Li}_2\left (-\frac {\sqrt {g} (d+e x)}{e \sqrt {-f}-d \sqrt {g}}\right )}{2 \left (e (-f)^{3/2}+d f \sqrt {g}\right ) \sqrt {g}}+\frac {b n \left (a+b \log \left (c (d+e x)^n\right )\right ) \text {Li}_2\left (-\frac {\sqrt {g} (d+e x)}{e \sqrt {-f}-d \sqrt {g}}\right )}{2 (-f)^{3/2} \sqrt {g}}-\frac {b^2 e n^2 \text {Li}_2\left (\frac {\sqrt {g} (d+e x)}{e \sqrt {-f}+d \sqrt {g}}\right )}{2 f \left (e \sqrt {-f}+d \sqrt {g}\right ) \sqrt {g}}-\frac {b n \left (a+b \log \left (c (d+e x)^n\right )\right ) \text {Li}_2\left (\frac {\sqrt {g} (d+e x)}{e \sqrt {-f}+d \sqrt {g}}\right )}{2 (-f)^{3/2} \sqrt {g}}-\frac {b^2 n^2 \text {Li}_3\left (-\frac {\sqrt {g} (d+e x)}{e \sqrt {-f}-d \sqrt {g}}\right )}{2 (-f)^{3/2} \sqrt {g}}+\frac {b^2 n^2 \text {Li}_3\left (\frac {\sqrt {g} (d+e x)}{e \sqrt {-f}+d \sqrt {g}}\right )}{2 (-f)^{3/2} \sqrt {g}} \\ \end{align*}
Result contains complex when optimal does not.
Time = 3.37 (sec) , antiderivative size = 1143, normalized size of antiderivative = 1.39 \[ \int \frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2}{\left (f+g x^2\right )^2} \, dx=\frac {\frac {2 \sqrt {f} x \left (a-b n \log (d+e x)+b \log \left (c (d+e x)^n\right )\right )^2}{f+g x^2}+\frac {2 \arctan \left (\frac {\sqrt {g} x}{\sqrt {f}}\right ) \left (a-b n \log (d+e x)+b \log \left (c (d+e x)^n\right )\right )^2}{\sqrt {g}}+\frac {2 b n \left (a-b n \log (d+e x)+b \log \left (c (d+e x)^n\right )\right ) \left (\frac {\sqrt {f} \left (\sqrt {g} (d+e x) \log (d+e x)+i e \left (\sqrt {f}+i \sqrt {g} x\right ) \log \left (i \sqrt {f}-\sqrt {g} x\right )\right )}{\left (e \sqrt {f}-i d \sqrt {g}\right ) \left (\sqrt {f}+i \sqrt {g} x\right )}+\frac {\sqrt {f} \left (\sqrt {g} (d+e x) \log (d+e x)+e \left (-i \sqrt {f}-\sqrt {g} x\right ) \log \left (i \sqrt {f}+\sqrt {g} x\right )\right )}{\left (e \sqrt {f}+i d \sqrt {g}\right ) \left (\sqrt {f}-i \sqrt {g} x\right )}-i \left (\log (d+e x) \log \left (\frac {e \left (\sqrt {f}+i \sqrt {g} x\right )}{e \sqrt {f}-i d \sqrt {g}}\right )+\operatorname {PolyLog}\left (2,-\frac {i \sqrt {g} (d+e x)}{e \sqrt {f}-i d \sqrt {g}}\right )\right )+i \left (\log (d+e x) \log \left (\frac {e \left (\sqrt {f}-i \sqrt {g} x\right )}{e \sqrt {f}+i d \sqrt {g}}\right )+\operatorname {PolyLog}\left (2,\frac {i \sqrt {g} (d+e x)}{e \sqrt {f}+i d \sqrt {g}}\right )\right )\right )}{\sqrt {g}}+\frac {b^2 n^2 \left (-\frac {\sqrt {f} \left (-\sqrt {g} (d+e x) \log ^2(d+e x)+2 e \left (i \sqrt {f}+\sqrt {g} x\right ) \log (d+e x) \log \left (\frac {e \left (\sqrt {f}-i \sqrt {g} x\right )}{e \sqrt {f}+i d \sqrt {g}}\right )+2 e \left (i \sqrt {f}+\sqrt {g} x\right ) \operatorname {PolyLog}\left (2,\frac {i \sqrt {g} (d+e x)}{e \sqrt {f}+i d \sqrt {g}}\right )\right )}{\left (e \sqrt {f}+i d \sqrt {g}\right ) \left (\sqrt {f}-i \sqrt {g} x\right )}+\frac {\sqrt {f} \left (\log (d+e x) \left (\sqrt {g} (d+e x) \log (d+e x)+2 i e \left (\sqrt {f}+i \sqrt {g} x\right ) \log \left (\frac {e \left (\sqrt {f}+i \sqrt {g} x\right )}{e \sqrt {f}-i d \sqrt {g}}\right )\right )+2 i e \left (\sqrt {f}+i \sqrt {g} x\right ) \operatorname {PolyLog}\left (2,\frac {\sqrt {g} (d+e x)}{i e \sqrt {f}+d \sqrt {g}}\right )\right )}{\left (e \sqrt {f}-i d \sqrt {g}\right ) \left (\sqrt {f}+i \sqrt {g} x\right )}+i \left (\log ^2(d+e x) \log \left (1-\frac {\sqrt {g} (d+e x)}{-i e \sqrt {f}+d \sqrt {g}}\right )+2 \log (d+e x) \operatorname {PolyLog}\left (2,\frac {\sqrt {g} (d+e x)}{-i e \sqrt {f}+d \sqrt {g}}\right )-2 \operatorname {PolyLog}\left (3,\frac {\sqrt {g} (d+e x)}{-i e \sqrt {f}+d \sqrt {g}}\right )\right )-i \left (\log ^2(d+e x) \log \left (1-\frac {\sqrt {g} (d+e x)}{i e \sqrt {f}+d \sqrt {g}}\right )+2 \log (d+e x) \operatorname {PolyLog}\left (2,\frac {\sqrt {g} (d+e x)}{i e \sqrt {f}+d \sqrt {g}}\right )-2 \operatorname {PolyLog}\left (3,\frac {\sqrt {g} (d+e x)}{i e \sqrt {f}+d \sqrt {g}}\right )\right )\right )}{\sqrt {g}}}{4 f^{3/2}} \]
[In]
[Out]
\[\int \frac {{\left (a +b \ln \left (c \left (e x +d \right )^{n}\right )\right )}^{2}}{\left (g \,x^{2}+f \right )^{2}}d x\]
[In]
[Out]
\[ \int \frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2}{\left (f+g x^2\right )^2} \, dx=\int { \frac {{\left (b \log \left ({\left (e x + d\right )}^{n} c\right ) + a\right )}^{2}}{{\left (g x^{2} + f\right )}^{2}} \,d x } \]
[In]
[Out]
Timed out. \[ \int \frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2}{\left (f+g x^2\right )^2} \, dx=\text {Timed out} \]
[In]
[Out]
\[ \int \frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2}{\left (f+g x^2\right )^2} \, dx=\int { \frac {{\left (b \log \left ({\left (e x + d\right )}^{n} c\right ) + a\right )}^{2}}{{\left (g x^{2} + f\right )}^{2}} \,d x } \]
[In]
[Out]
\[ \int \frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2}{\left (f+g x^2\right )^2} \, dx=\int { \frac {{\left (b \log \left ({\left (e x + d\right )}^{n} c\right ) + a\right )}^{2}}{{\left (g x^{2} + f\right )}^{2}} \,d x } \]
[In]
[Out]
Timed out. \[ \int \frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2}{\left (f+g x^2\right )^2} \, dx=\int \frac {{\left (a+b\,\ln \left (c\,{\left (d+e\,x\right )}^n\right )\right )}^2}{{\left (g\,x^2+f\right )}^2} \,d x \]
[In]
[Out]